<?php
namespace Admin\Controller;

class AdminRoleController extends CommonController{
	public  $exec_comfunc  = 'index,add,edit,delete';//index,add,edit,delete
	//角色列表
	public function index(){
		parent::index('','','id');
	}
	//添加角色权限
	public function add(){
		//栏目信息
		$this->menu_info = C('MENU_LIST');
		if(IS_POST){
			$auths         = $_POST['auths'];
			$data['auths'] = serialize($auths);
		}
		parent::add('',$data);
	}
	//修改角色权限
	public function edit(){
		//栏目信息
		$this->menu_info = C('MENU_LIST');
		if(IS_POST){
			$auths         = $_POST['auths'];
			$data['auths'] = serialize($auths);
		}
		$where['id'] = $this->_get('id');
		$info = D('AdminRole')->where($where)->find();
		$auths = unserialize($info['auths']);
		$this->_set_info['auths'] = $auths;
		parent::edit('',$data);
	}
}
